home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 December / macformat-019.iso / Shareware City / Developers / Gnuplot 3.5 for Macintosh / docs / gpcard.tex < prev    next >
Encoding:
Text File  |  1993-11-03  |  40.3 KB  |  1,042 lines  |  [TEXT/MSWD]

  1. % Quick Reference Card for GNUPLOT 1992
  2. % Format stolen shamelessly from the GNU Emacs reference card
  3. %**start of header
  4. \special{landscape}
  5. \newcount\columnsperpage
  6.  
  7. % This file can be printed with 1, 2, or 3 columns per page (see below).
  8. % Specify how many you want here.  Nothing else needs to be changed.
  9. % For GNUPLOT refcard, entries are too wide for 3 columns.  Print
  10. % 2 columns landscape
  11.  
  12. \columnsperpage=2
  13.  
  14. % Copyright (c) 1987 Free Software Foundation, Inc.
  15.  
  16. % This file is part of GNU Emacs, but was adapted for the GNUPLOT
  17. % reference card because it was so nicely set up.
  18.  
  19. % This file is intended to be processed by plain TeX (TeX82).
  20. %
  21. % The final reference card has six columns, three on each side.
  22. % This file can be used to produce it in any of three ways:
  23. % 1 column per page
  24. %    produces six separate pages, each of which needs to be reduced to 80%.
  25. %    This gives the best resolution.
  26. % 2 columns per page
  27. %    produces three already-reduced pages.
  28. %    You will still need to cut and paste.
  29. % 3 columns per page
  30. %    produces two pages which must be printed sideways to make a
  31. %    ready-to-use 8.5 x 11 inch reference card.
  32. %    For this you need a dvi device driver that can print sideways.
  33. % Which mode to use is controlled by setting \columnsperpage above.
  34. %
  35. % Author of GNU Emacs Refcard:
  36. %  Stephen Gildea
  37. %  UUCP: mit-erl!gildea
  38. %  Internet: gildea@erl.mit.edu
  39. %
  40. % Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
  41. % for their many good ideas.
  42. %
  43. % Person who ripped off the formatter:
  44. %  Alex Woo
  45. %  NASA Ames Research Center
  46. %  Internet: woo@ames.arc.nasa.gov
  47. %
  48. % Modified on 9 Dec 1992 by:
  49. %  Daniel S. Lewart
  50. %  University of Illinois
  51. %  Internet: d-lewart@uiuc.edu
  52.  
  53. % make \bye not \outer so that the \def\bye in the \else clause below
  54. % can be scanned without complaint.
  55. \def\bye{\par\vfill\supereject\end}
  56.  
  57. \def\copyrightnotice{
  58. \vskip 1ex plus 2 fill\begingroup\small
  59. Layout adapted from the \TeX\ source for Stephen Gildea's GNU Emacs
  60. Reference Card (version 1.8).
  61.  
  62. PostScript is a registered trademark of Adobe Systems Incorporated.
  63. GNU, Versatec, Imagen, Printronix, Canon, GraphOn, Visual, MicroVAX,
  64. UIS, Tektronix, Unix, VAX, VMS, NeWS, SunView, and em4010 are all
  65. trademarks of various companies.  We endorse none of them.
  66.  
  67. \endgroup}
  68.  
  69. \newdimen\intercolumnskip
  70. \newbox\columna
  71. \newbox\columnb
  72.  
  73. \def\ncolumns{\the\columnsperpage}
  74.  
  75. \message{[\ncolumns\space
  76.   column\if 1\ncolumns\else s\fi\space per page]}
  77.  
  78. \def\scaledmag#1{ scaled \magstep #1}
  79.  
  80. % This multi-way format was designed by Stephen Gildea
  81. % October 1986.
  82. % modified for GNUPLOT refcard by Alex Woo
  83.  
  84. \if 1\ncolumns
  85. %  \hsize 4in
  86.   \hsize 6in
  87.   \vsize 10in
  88.   \voffset -.7in
  89.   \font\titlefont=\fontname\tenbf \scaledmag3
  90.   \font\headingfont=\fontname\tenbf \scaledmag2
  91.   \font\smallfont=\fontname\sevenrm
  92.   \font\smallsy=\fontname\sevensy
  93.  
  94.   \footline{\hss\folio}
  95.   \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}}
  96. \else
  97. %  \hsize 3.2in
  98.   \hsize 5in
  99.   \vsize 7.95in
  100.   \hoffset -.75in
  101.   \voffset -.745in
  102.   \font\titlefont=cmbx10 \scaledmag2
  103.   \font\headingfont=cmbx10 \scaledmag1
  104.   \font\smallfont=cmr6
  105.   \font\smallsy=cmsy6
  106.   \font\eightrm=cmr8
  107.   \font\eightbf=cmbx8
  108.   \font\eightit=cmti8
  109.   \font\eighttt=cmtt8
  110.   \font\eightsy=cmsy8
  111.   \textfont0=\eightrm
  112.   \textfont2=\eightsy
  113.   \def\rm{\eightrm}
  114.   \def\bf{\eightbf}
  115.   \def\it{\eightit}
  116.   \def\tt{\eighttt}
  117.   \normalbaselineskip=.8\normalbaselineskip
  118.   \normallineskip=.8\normallineskip
  119.   \normallineskiplimit=.8\normallineskiplimit
  120.   \normalbaselines\rm           %make definitions take effect
  121.  
  122.   \if 2\ncolumns
  123.     \let\maxcolumn=b
  124.     \footline{\hss\rm\folio\hss}
  125.     \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}}
  126.   \else \if 3\ncolumns
  127.     \let\maxcolumn=c
  128.     \nopagenumbers
  129.   \else
  130.     \errhelp{You must set \columnsperpage equal to 1, 2, or 3.}
  131.     \errmessage{Illegal number of columns per page}
  132.   \fi\fi
  133.  
  134.   \intercolumnskip=.46in
  135.   \def\abc{a}
  136.   \output={%
  137.       % This next line is useful when designing the layout.
  138.       %\immediate\write16{Column \folio\abc\space starts with \firstmark}
  139.       \if \maxcolumn\abc \multicolumnformat \global\def\abc{a}
  140.       \else\if a\abc
  141.         \global\setbox\columna\columnbox \global\def\abc{b}
  142.         %% in case we never use \columnb (two-column mode)
  143.         \global\setbox\columnb\hbox to -\intercolumnskip{}
  144.       \else
  145.         \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
  146.   \def\multicolumnformat{\shipout\vbox{\makeheadline
  147.       \hbox{\box\columna\hskip\intercolumnskip
  148.         \box\columnb\hskip\intercolumnskip\columnbox}
  149.       \makefootline}\advancepageno}
  150.   \def\columnbox{\leftline{\pagebody}}
  151.  
  152.   \def\bye{\par\vfill\supereject
  153.     \if a\abc \else\null\vfill\eject\fi
  154.     \if a\abc \else\null\vfill\eject\fi
  155.     \end}
  156. \fi
  157.  
  158. % we won't be using math mode much, so redefine some of the characters
  159. % we might want to talk about
  160. \catcode`\^=12
  161. \catcode`\_=12
  162.  
  163. \chardef\\=`\\
  164. \chardef\{=`\{
  165. \chardef\}=`\}
  166.  
  167. \hyphenation{mini-buf-fer}
  168.  
  169. \parindent 0pt
  170. \parskip 1ex plus .5ex minus .5ex
  171.  
  172. \def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}
  173.  
  174. \outer\def\newcolumn{\vfill\eject}
  175.  
  176. \outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex}
  177.  
  178. \outer\def\section#1{\par\filbreak
  179.   \vskip 3ex plus 2ex minus 2ex {\headingfont #1}\mark{#1}%
  180.   \vskip 2ex plus 1ex minus 1.5ex}
  181.  
  182. \newdimen\keyindent
  183.  
  184. \def\beginindentedkeys{\keyindent=1em}
  185. \def\endindentedkeys{\keyindent=0em}
  186. \endindentedkeys
  187.  
  188. \def\paralign{\vskip\parskip\halign}
  189.  
  190. \def\<#1>{$\langle${\rm #1}$\rangle$}
  191.  
  192. \def\kbd#1{{\tt#1}\null}        %\null so not an abbrev even if period follows
  193.  
  194. \def\beginexample{\par\leavevmode\begingroup
  195.   \obeylines\obeyspaces\parskip0pt\tt}
  196. {\obeyspaces\global\let =\ }
  197. \def\endexample{\endgroup}
  198.  
  199.  
  200. \def\key#1#2{\leavevmode\hbox to \hsize{\vtop
  201. %  {\hsize=.75\hsize\rightskip=1em
  202.   {\hsize=.5\hsize\rightskip=1em
  203.   \hskip\keyindent\relax#1}\kbd{#2}\hfil}}
  204.  
  205. \newbox\metaxbox
  206. \setbox\metaxbox\hbox{\kbd{M-x }}
  207. \newdimen\metaxwidth
  208. \metaxwidth=\wd\metaxbox
  209.  
  210. \def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize
  211.   {\hskip\keyindent\relax#1\hfil}%
  212.   \hskip -\metaxwidth minus 1fil
  213.   \kbd{#2}\hfil}}
  214.  
  215. \def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad
  216.   &\kbd{#3}\quad\cr}
  217.  
  218. %**end of header
  219.  
  220.  
  221. \title{GNUPLOT Quick Reference}
  222.  
  223. \centerline{(Copyright(c) Alex Woo 1992 June 1)}
  224.  
  225. \section{Starting GNUPLOT}
  226.  
  227. \key{to enter GNUPLOT}{gnuplot}
  228. \key{to enter batch GNUPLOT}{gnuplot macro_file}
  229. \key{to pipe commands to GNUPLOT}{application | gnuplot}
  230.  
  231. see below for  environment variables you might want to change
  232. before entering GNUPLOT.
  233.  
  234. \section{Exiting GNUPLOT}
  235.  
  236. \key{exit GNUPLOT}{quit}
  237.  
  238. All GNUPLOT commands can be abbreviated to the first few
  239. unique letters, usually three characters.  This reference uses
  240. the complete name for clarity.
  241.  
  242. \section{Getting Help}
  243.  
  244. \key{introductory help} {help plot}
  245. \key{help on a topic}{help <topic>}
  246. \key{list of all help available}{help or ?}
  247. \key{show current environment}{show all}
  248. \section{Command-line Editing}
  249.  
  250. The UNIX, MS-DOS and VMS versions of GNUPLOT support command-line
  251. editing and a command history.  EMACS style editing is supported.
  252.  
  253. \beginindentedkeys
  254.  
  255. Line Editing:
  256.  
  257. \key{move back a single character}{^ B}
  258. \key{move forward a single character}{^ F}
  259. \key{moves to the beginning of the line}{^ A}
  260. \key{moves to the end of the line}{^ E}
  261. \key{delete the previous character} {^ H and DEL }
  262. \key{deletes the current character}  {^ D}
  263. \key{deletes to the end of line}{^ K}
  264. \key{redraws line in case it gets trashed}{ ^ L,^ R}
  265. \key{deletes the entire line}{ ^ U}
  266. \key{deletes the last word}{ ^ W}
  267. \endindentedkeys
  268. \beginindentedkeys
  269.  
  270. History:
  271.  
  272. \key{moves back through history}{ ^ P }
  273. \key{moves forward through history}{ ^ N }
  274. \endindentedkeys
  275.  
  276. The following arrow keys may be used on the MS-DOS version if READLINE is
  277. used.
  278.  
  279. \beginindentedkeys
  280. IBM PC Arrow Keys:
  281.  
  282. \key{Left  Arrow}{same as ^ B}
  283. \key{Right Arrow}{same as ^ F}
  284. \key{Ctrl Left  Arrow}{same as ^ A}
  285. \key{Ctrl Right Arrow}{same as ^ E}
  286. \key{Up    Arrow}{same as ^ P}
  287. \key{Down  Arrow}{same as ^ N}
  288. \endindentedkeys
  289.  
  290.  
  291.  
  292. \section{Graphics Devices}
  293.  
  294. All screen graphics devices are specified by names and options.
  295. This information can be read from a startup file (.gnuplot in UNIX).
  296. If  you change the graphics device, you must replot with the
  297. \kbd{replot} command.
  298.  
  299. \key{get a list of valid devices }{set terminal [options]}
  300.  
  301. \beginindentedkeys
  302.  
  303. Graphics Terminals:
  304.  
  305. \key{AED 512 Terminal}                          {set term aed512}
  306. \key{AED 767 Terminal}                          {set term aed767}
  307. \key{Amiga}                                     {set term amiga}
  308. \key{Adobe Illustrator 3.0 Format}              {set term aifm}
  309. \key{Apollo graphics primitive, rescalable}     {set term apollo}
  310. \key{Atari ST}                                  {set term atari}
  311. \key{BBN Bitgraph Terminal}                     {set term bitgraph}
  312. \key{SCO CGI Driver}                            {set term cgi}
  313. \key{Apollo graphics primitive, fixed window}   {set term gpr}
  314. \key{SGI GL windown}                            {set term iris4d [8 24]}
  315. \key{MS-DOS Kermit Tek4010 term - color}        {set term kc_tek40xx}
  316. \key{MS-DOS Kermit Tek4010 term - mono}         {set term km_tek40xx}
  317. \key{NeXTstep window system}                    {set term next}
  318. \key{REGIS graphics language}                   {set term regis}
  319. \key{Selanar Tek Terminal}                      {set term selanar}
  320. \key{SunView window system}                     {set term sun}
  321. \key{Tektronix 4106, 4107, 4109 \& 420X }       {set term tek4OD10x}
  322. \key{Tektronix 4010; most TEK emulators}        {set term tek40xx}
  323. \key{VAX UIS window system}                     {set term VMS}
  324. \key{VT-like tek40xx terminal emulator}         {set term vttek}
  325. \key{UNIX plotting (not always supplied)}       {set term unixplot}
  326. \key{AT\&T 3b1 or 7300 UNIXPC}                  {set term unixpc}
  327. \key{X11 default display device}                {set term x11}
  328. \key{X11 multicolor point default device}       {set term X11}
  329.  
  330. \endindentedkeys
  331.  
  332. \beginindentedkeys
  333.  
  334. Turbo C PC Graphics Modes:
  335.  
  336. \key{Hercules}{set term hercules}
  337. \key{Color Graphics Adaptor}{set term cga}
  338. \key{Monochrome CGA}{set term mcga}
  339. \key{Extended Graphics Adaptor}{set term ega}
  340. \key{VGA} {set term vga}
  341. \key{Monochrome VGA} {set term vgamono}
  342. \key{Super VGA - requires SVGA driver}{set term svga}
  343. \key{AT\&T 6300 Micro}{set term att}
  344.  
  345. \endindentedkeys
  346.  
  347. MS Windows 3.x and OS/2 Presentation Manager are also supported.
  348.  
  349. \beginindentedkeys
  350.  
  351. Hardcopy Devices:
  352.  
  353. \key{Unknown - not a plotting device} {set term unknown}
  354. \key{Dump ASCII table of X Y [Z] values}{set term table}
  355. \key{printer or glass dumb terminal}                    {set term dumb}
  356. \key{Roland DXY800A plotter}                            {set term dxy800a}
  357.  
  358. Dot Matrix Printers
  359.  
  360. \key{Epson-style 60-dot per inch printers}              {set term epson_60dpi}
  361. \key{Epson LX-800, Star NL-10 }{set term epson_lx800}
  362. \key{NX-1000, PROPRINTER }{set term epson_lx800}
  363. \key{NEC printer CP6, Epson LQ-800 }
  364.                         {set term nec_cp6 [monochrome color draft]}
  365. \key{Star Color Printer}                                {set term starc}
  366. \key{Tandy DMP-130  60-dot per inch }   {set term tandy_60dpi}
  367. \key{Vectrix 384 \& Tandy color printer}                {set term vx384}
  368.  
  369. Laser Printers
  370.  
  371. \key{Talaris EXCL language}{set term excl}
  372. \key{Imagen laser printer}                              {set term imagen}
  373. \key{LN03-Plus in EGM mode}                     {set term ln03}
  374. \key{PostScript graphics language }
  375.                 {set term post [mode color `font' size]}
  376. \key{CorelDraw EPS}
  377.                 {set term corel [mode color `font' size]}
  378. \key{Prescribe - for the Kyocera Laser Printer} {set term prescribe}
  379. \key{Kyocera Laser Printer with Courier font}           {set term kyo}
  380. \key{QMS/QUIC Laser  (also Talaris 1200 )}{set term qms}
  381.  
  382. Metafiles
  383.  
  384. \key{AutoCAD DXF (120x80 default)}                      {set term dxf}
  385. \key{FIG graphics language: SunView or X }{set term fig}
  386. \key{FIG graphics language:  Large Graph}{set term bfig}
  387. \key{SCO hardcopy CGI}{set term hcgi}
  388. \key{Frame Maker MIF 3.0}
  389.                 {set term mif [pentype curvetype help]}
  390. \key{Portable bitmap}                                   {set term pbm [fontsize color]}
  391. \key{Uniplex Redwood Graphics Interface Protocol}{set term rgip}
  392. \key{TGIF language}                             {set term tgif}
  393.  
  394. HP Devices
  395.  
  396. \key{HP2623A and maybe others}                  {set term hp2623A}
  397. \key{HP2648 and HP2647}                         {set term hp2648}
  398. \key{HP7580, \& probably other HPs (4 pens)}            {set term hp7580B}
  399. \key{HP7475 \&  lots of others (6 pens)}        {set term hpgl}
  400. \key{HP Laserjet series II \& clones}   {set term hpljii [75 100 150 300]}
  401. \key{HP DeskJet 500} {set term hpdj [75 100 150 300]}
  402. \key{HP PaintJet \& HP3630 }
  403.                                 {set term hppj [FNT5X9 FNT9X17 FNT13x25]}
  404. \key{HP laserjet III ( HPGL plot vectors)}
  405.                 {set term pcl5 [mode font fontsize ]}
  406.  
  407. TeX picture environments
  408.  
  409. \key{LaTeX picture environment}                 {set term latex}
  410. \key{EEPIC -- extended LaTeX picture }  {set term eepic}
  411. \key{LaTeX picture  with emTeX specials}        {set term emtex}
  412. \key{PSTricks macros for TeX or LaTeX}  {set term pstricks}
  413. \key{TPIC specials for TeX or LaTeX}    {set term tpic}
  414. \key{MetaFont font generation input}                    {set term mf}
  415.  
  416.  
  417. \endindentedkeys
  418.  
  419. \section{Files}
  420.  
  421. \key{{\bf plot} a data file}{plot `fspec'}
  422. \key{{\bf load} in a macro file}{load `fspec'}
  423. \key{{\bf save} command buffer to a macro file}{save `fspec'}
  424. \key{{\bf save settings} for later reuse}{save set `fpec'}
  425.  
  426. \section{PLOT \& SPLOT commands}
  427.  
  428.  
  429. {\bf plot} and {\bf splot} are the primary commands
  430. {\bf plot} is used to plot 2-d
  431. functions and data, while {\bf splot} plots 3-d surfaces and data.
  432.  
  433. Syntax:
  434.  
  435.         plot $\{$ranges$\}$ $<$function$> \{$title$\} \{$style$\}$
  436.                     $\{, <$function$> \{$title$\} \{$style$\}...\}$
  437.  
  438.         splot $\{$ranges$\} <$function$> \{$title$\} \{$style$\}$
  439.                     $\{, <$function$> \{$title$\} \{$style$\}...\}$
  440.  
  441. where $<$function$>$ is either a mathematical expression, the name of a
  442. data file enclosed in quotes, or a pair ({\bf plot}) or triple ({\bf splot})
  443. of mathematical expressions in the case of parametric functions.
  444. User-defined functions and variables may also be defined here.
  445. Examples will be given below.
  446.  
  447. \section{Plotting Data}
  448. Discrete data contained in a file can displayed by specifying the
  449. name of the data file (enclosed in quotes) on the {\bf plot} or {\bf splot}
  450. command line. Data files should contain one data point per line.
  451. Lines beginning with \# (or ! on VMS) will be treated as comments
  452. and ignored. For {\bf plot}s, each data point represents an (x,y)
  453. pair. For {\bf splot}s, each point is an (x,y,z) triple. For {\bf plot}s with
  454. error bars (see {\bf plot errorbars}), each data point is either
  455. (x,y,ydelta) or (x,y,ylow,yhigh). In all cases, the numbers on each
  456. line of a data file must be separated by blank space. This blank
  457. space divides each line into columns.
  458.  
  459. For {\bf plot}s the x value may be omitted, and for {\bf splot}s the x
  460. and y values may be omitted. In either case the omitted values are
  461. assigned the current coordinate number. Coordinate numbers start at 0
  462. and are incremented for each data point read.
  463.  
  464. \section{Surface Plotting}
  465. Implicitly, there are two types of 3-d datafiles. If all the isolines
  466. are of the same length, the data is assumed to be a grid data, i.e.,
  467. the data has a grid topology. Cross isolines in the other parametric
  468. direction (the ith cross isoline passes thru the ith point of all the
  469. provided isolines) will also be drawn for grid data. (Note contouring
  470. is available for grid data only.) If all the isolines are not of the
  471. same length, no cross isolines will be drawn and contouring that data
  472. is impossible.
  473.  
  474. For splot if 3-d datafile and using format (see {\bf splot datafile using})
  475. specify only z (height field), a non parametric mode must be specified.
  476. If, on the other hand, x, y, and z are all specified, a parametric
  477. mode should be selected (see {\bf set parametric}) since data is defining a
  478. parametric surface.
  479.  
  480. \key{example of plotting a 3-d data}{set parametric;splot 'glass.dat'}
  481. \key{example of plotting explicit}{set noparametric;splot 'datafile.dat'}
  482.  
  483. \section{Using Pipes}
  484.  
  485. On some computer systems with a popen function (UNIX), the datafile
  486. can be piped through a shell command by starting the file name
  487. with a '$<$'.  For example:
  488.  
  489.         pop(x) = 103*exp(x/10)
  490.         plot "$<$ awk '$\{$ print \$1-1965 \$2 $\}$' population.dat", pop(x)
  491.  
  492. would plot the same information as the first population example
  493. but with years since 1965 as the x axis.
  494.  
  495. Similarly, output can be piped to another application, e.g.
  496.  
  497.         set out "$|$lpr -Pmy\_laser\_printer"
  498.  
  499. \section{Plot Data Using}
  500. The format of data within a file can be selected with the {\bf using}
  501. option. An explicit scanf string can be used, or simpler column
  502. choices can be made.
  503.  
  504. \key{plot "datafile"}{ $\{$ using $\{ <$ycol$> |$}
  505. \key{}{$<$xcol$>:<$ycol$> |$}
  506. \key{}{$<$xcol$>:<$ycol$>:<$ydelta$> |$}
  507. \key{}{$<$xcol$>:<$ycol$>:<$ylow$>:<$yhigh$> \}$}
  508. \key{}{$\{$"<scanf string>"$\} \} ...$}
  509.  
  510. \key{splot "datafile"}
  511. {$\{$ using $\{ <$xcol$>:<$ycol$>:<$zcol$> \}$}
  512. \key{}{$\{"<$scanf string$>"\} \} ...$}
  513.  
  514. $<$xcol$>$, $<$ycol$>$, and $<$zcol$>$ explicitly select the columns to plot from
  515. a space or tab separated multicolumn data file. If only $<$ycol$>$ is
  516. selected for {\bf plot}, $<$xcol$>$ defaults to 1. If only $<$zcol$>$ is selected
  517. for {\bf splot}, then only that column is read from the file. An $<$xcol$>$ of
  518. 0 forces $<$ycol$>$ to be plotted versus its coordinate number. $<$xcol$>$,
  519. $<$ycol$>$, and $<$zcol$>$ can be entered as constants or expressions.
  520.  
  521. If errorbars (see also {\bf plot errorbars}) are used for {\bf plot}s,
  522. ydelta (for example, a +/- error) should be provided as the third
  523. column, or ylow and yhigh as third and fourth columns.  These columns
  524. must follow the x and y columns.
  525.  
  526. Scanf strings override any $<$xcol$>$:$<$ycol$>$(:$<$zcol$>$) choices, except for
  527. ordering of input, e.g.,
  528.  
  529. \key{plot "datafile"}{ using 2:1 "\%f\%*f\%f"}
  530.  
  531. causes the first column to be y and the third column to be x.
  532.  
  533. If the scanf string is omitted, the default is generated based on the
  534. $<$xcol$>$:$<$ycol$>$(:$<$zcol$>$) choices. If the {\bf using} option is omitted, ''\%f\%f''
  535. is used for {\bf plot} (''\%f\%f\%f\%f'' for {\bf errorbar} {\bf plot}s) and ''\%f\%f\%f'' is
  536. used for {\bf splot}.
  537.  
  538. \key{plot "MyData"} {using "\%*f\%f\%*20[^$\backslash$n]\%f" w lines}
  539.  
  540. Data are read from the file ``MyData'' using the format
  541. ''\%*f\%f\%*20[^$\backslash$n]\%f''. The meaning of this format is: ''\%*f'' ignore the
  542. first number, ''\%f'' then read in the second and assign to x,
  543. ''\%*20[^$\backslash$n]'' then ignore 20 non-newline characters, ''\%f'' then read in
  544. the y value.
  545.  
  546. \section{Plot With Errorbars}
  547. Error bars are supported for 2-d data file plots by reading one or
  548. two additional columns specifying ydelta or ylow and yhigh
  549. respectively. No support exists for x error bars or any error bars
  550. for {\bf splot}s.
  551.  
  552. In the default situation, GNUPLOT expects to see three or four
  553. numbers on each line of the data file, either (x, y, ydelta) or
  554. (x, y, ylow, yhigh). The x coordinate must be specified. The order
  555. of the numbers must be exactly as given above. Data files in this
  556. format can easily be plotted with error bars:
  557.  
  558.         plot "data.dat" with errorbars
  559.  
  560. The error bar is a vertical line plotted from (x, ylow) to (x,
  561. yhigh). If ydelta is specified instead of ylow and yhigh,
  562. ylow=y-ydelta and yhigh=y+ydelta are derived. If there
  563. are only two numbers on the line, yhigh and ylow are both set to
  564. y. To get lines plotted between the data points, {\bf plot} the
  565. data file twice, once with errorbars and once with lines.
  566.  
  567. If y autoscaling is on, the y range will be adjusted to fit the
  568. error bars.
  569.  
  570. \key{x,y,ylow \& yhigh from columns 1,2,3,4}{plot "data.dat" us 1:2:3:4 w errorbars}
  571. \key{x from third, y from second, ydelta from 6}{plot "data.dat" using 3:2:6 with errorbars}
  572.  
  573. \section{Plot Ranges}
  574. The optional range specifies the region of the plot that will be
  575. displayed.
  576.  
  577. Ranges may be provided on the {\bf plot} and {\bf splot} command line and
  578. affect only that plot, or in the {\bf set xrange}, {\bf set yrange}, etc.,
  579. commands, to change the default ranges for future plots.
  580.  
  581. \key{[$\{<$dummy-var$> =\} \{<$xmin$> : <$xmax$>\}$]} { $\{$ [$\{<$ymin$> : <$ymax$>\}$] $\}$}
  582.  
  583. where $<$dummy-var$>$ is the independent variable (the defaults are x and
  584. y, but this may be changed with {\bf set dummy}) and the min and max
  585. terms can be constant expressions.
  586.  
  587. Both the min and max terms are optional. The ':' is also optional
  588. if neither a min nor a max term is specified. This allows '[ ]' to
  589. be used as a null range specification.
  590.  
  591. Specifying a range in the {\bf plot} command line turns autoscaling for
  592. that axis off for that plot. Using one of the {\bf set} range commands
  593. turns autoscaling off for that axis for future plots, unless changed
  594. later. (See {\bf set autoscale}).
  595.  
  596. \key{This uses the current ranges}{plot cos(x)}
  597. \key{This sets the x range only}{plot [-10:30] sin(pi*x)/(pi*x)}
  598. \key{This sets both the x and y ranges}{plot [-pi:pi] [-3:3]  tan(x), 1/x}
  599. \key{sets only y range, \&} {plot [ ] [-2:sin(5)*-8] sin(x)**besj0(x)}
  600. \key{turns off autoscaling on both axes}{}
  601. \key{This sets xmax and ymin only}{plot [:200] [-pi:]  exp(sin(x))}
  602. \key{This sets the x, y, and z ranges}{splot [0:3] [1:4] [-1:1] x*y}
  603.  
  604. \section{Plot With Style}
  605. Plots may be displayed in one of six styles: {\bf lines}, {\bf points},
  606. {\bf linespoints}, {\bf impulses}, {\bf dots}, {\bf steps},
  607. or {\bf errorbars}. The {\bf lines} style
  608. connects adjacent points with lines. The {\bf points} style displays a
  609. small symbol at each point. The {\bf linespoints} style does both
  610. {\bf lines} and {\bf points}. The {\bf impulses} style displays a vertical line
  611. from the x axis (or from the grid base for {\bf splot}) to each point. The
  612. {\bf dots} style plots a tiny dot at each point; this is useful for
  613. scatter plots with many points.
  614.  
  615. The {\bf errorbars} style is only relevant to 2-d data file plotting. It
  616. is treated like {\bf points} for {\bf splot}s and function {\bf plot}s. For data
  617. {\bf plot}s, {\bf errorbars} is like {\bf points}, except that a vertical error
  618. bar is also drawn: for each point (x,y), a line is drawn from
  619. (x,ylow) to (x,yhigh). A tic mark is placed at the ends of the error
  620. bar. The ylow and yhigh values are read from the data file's columns,
  621. as specified with the {\bf using} option to plot. See {\bf plot errorbars} for
  622. more information.
  623.  
  624. Default styles are chosen with the {\bf set function style} and
  625. {\bf set data style} commands.
  626.  
  627. By default, each function and data file will use a different
  628. line type and point type, up to the maximum number of available
  629. types. All terminal drivers support at least six different point
  630. types, and re-use them, in order, if more than six are required.
  631. The LaTeX driver supplies an additional six point types (all variants
  632. of a circle), and thus will only repeat after twelve curves are
  633. plotted with points.
  634.  
  635. If desired, the style and (optionally) the line type and point type
  636. used for a curve can be specified.
  637.  
  638. \key{with $<$style$>$}{$ \{<$linetype$> \{<$pointtype$>\}\}$}
  639.  
  640. where $<$style$>$ is either {\bf lines}, {\bf points}, {\bf linespoints}, {\bf impulses},
  641. {\bf dots}, {\bf steps}, or {\bf errorbars}.
  642. The $<$linetype$>$ \& $<$pointtype$>$ are positive
  643. integer constants or expressions and specify the line type and point
  644. type to be used for the plot. Line type 1 is the first line type used
  645. by default, line type 2 is the second line type used by default, etc.
  646.  
  647. \key{plots sin(x) with impulses}{plot sin(x) with impulses}
  648. \key{plots x*y with points, x**2 + y**2 default}{splot x*y w points, x**2 + y**2}
  649. \key{plots tan(x) with default function style}
  650.         {plot [ ] [-2:5] tan(x)}
  651. \key{plots ``data.1'' with lines}{plot "data.1" with l}
  652. \key{plots ``leastsq.dat'' with impulses} {plot 'leastsq.dat' w i}
  653. \key{plots ``exper.dat'' with errorbars \& }
  654. {plot 'exper.dat' w l, 'exper.dat' w err}
  655. \key{ lines connecting points}{}
  656.  
  657. Here 'exper.dat' should have three or four data columns.
  658.  
  659. \key{plots x**2 + y**2 and x**2 - y**2 with the same line type}
  660. {splot x**2 + y**2 w l 1, x**2 - y**2 w l 1}
  661. \key{plots sin(x) and cos(x) with linespoints, using}
  662.     {plot sin(x) w linesp 1 3, \\}
  663. \key{ the same line type but different point types}{ cos(x) w linesp 1 4}
  664. \key{plots file ``data'' with points style 3}
  665. {plot "data" with points 1 3}
  666.  
  667. Note that the line style must be specified when specifying the point
  668. style, even when it is irrelevant. Here the line style is 1 and the
  669. point style is 3, and the line style is irrelevant.
  670.  
  671. See {\bf set style} to change the default styles.
  672.  
  673. \section{Plot Title}
  674.  
  675. A title of each plot appears in the key. By default the title is
  676. the function or file name as it appears on the plot command line.
  677. The title can be changed by using the {\bf title} option. This option
  678. should precede any {\bf with} option.
  679.  
  680. \key{        title "$<$title$>$"}{}
  681.  
  682. where $<$title$>$ is the new title of the plot and must be enclosed in
  683. quotes. The quotes will not be shown in the key.
  684.  
  685. \key{plots y=x with the title 'x'} {plot x}
  686. \key{plots the ``glass.dat'' file}
  687. {splot "glass.dat" tit 'revolution surface'}
  688. \key{with the title 'revolution surface'}{}
  689. \key{plots x squared with title ``x^2'' and ``data.1''}
  690.     {plot x**2 t "x^2", \\}
  691. \key{ with title 'measured data'}{ "data.1" t 'measured data'}
  692.  
  693. \section{Set-Show Commands}
  694.  
  695. \beginindentedkeys
  696. \key{all commands below begin with set}{set}
  697. \key{set mapping of polar angles}{angles [degrees|radians]}
  698. \key{arrows from point to}{arrow [<tag>][from <sx>,<sy>,<sz>]}
  699. \key{}{ [to <ex>,<ey>,<ez>][nohead]}
  700. \key{force autoscaling of an axis}{autoscale [<axes>]}
  701. \key{enter/exit parametric mode} {[no]parametric}
  702. \key{display border}{[no]border}
  703. \key{clip points/line near boundaries}{[no]clip <clip-type>}
  704. \key{specify parameters for contour plots}{cntrparam
  705. [spline][points][order][levels]}
  706. \key{enable splot contour plots}{[no]contour [base|surface|both]}
  707. \key{default plotting style for data}{data style <style-choice>}
  708. \key{specify dummy variable}{dummy <dummy1>,<dummy2>...}
  709. \key{tic-mark label format specification}{format
  710. [<axes>]["format-string"]}
  711. \key{function plotting style}{function style <style-choice>}
  712. \key{draw a grid at tick marks}{[no]grid}
  713. \key{enables hiddenline removal}{[no]hidden3d}
  714. \key{specify number of isolines}{isosamples <expression>}
  715. \key{enables key of curves in plot}{key <x>,<y>,<z>}
  716. \key{logscaling of an axes (optionally giving base)}{logscale <axes> [<base>]}
  717. \key{mapping 3D coordinates}{mapping
  718. [cartesian|spherical|cylindrical]}
  719. \key{offsets from center of graph}{offsets
  720. <left>,<right>,<top>,<bottom>}
  721. \key{mapping 2D coordinates}{[no]polar}
  722. \key{set radial range}{rrange [<rmin>:<rmax>]}
  723. \key{set sampling rate of functions}{samples <expression>}
  724. \key{set scaling factors of plot}{size <xsize>,<ysize>}
  725. \key{control display of isolines of surface}{[no]surface}
  726. \key{control graphics device}{terminal <device>}
  727. \key{change direction of tics}{tics <direction>}
  728. \key{adjust relative height of vertical axis}{ticslevel <level>}
  729. \key{turn on time/date stamp}{[no]time}
  730. \key{set centered plot title}{title "title-text" <xoff>,<yoff>}
  731. \key{set parametric range}{trange [<tmin>:<tmax>]}
  732. \key{set surface parametric ranges}{urange or vrange}
  733. \key{sets the view point for {\bf splot}}{view
  734. <rot_x>,<rot_z>,<scale>,<scale_z>}
  735. \key{sets x-axis label}{xlabel "<label>" <xoff>,<yoff>}
  736. \key{set horizontal range}{xrange [<xmin>:<xmax>]}
  737. \key{change horizontal tics}{xtics <start>,<incr>,<end>,}
  738. \key{}{"<label>" <pos> }
  739. \key{draw x-axis}{[no]xzeroaxis}
  740. \key{sets y-axis label}{ylabel "<label>" <xoff>,<yoff>}
  741. \key{set vertical range}{yrange [<ymin>:<ymax>]}
  742. \key{change vertical tics}{ytics <start>,<incr>,<end>,}
  743. \key{}{"<label>" <pos> }
  744. \key{draw y-axis}{[no]yzeroaxis}
  745. \key{set default threshold for values near 0}{zero <expression>}
  746. \key{draw axes}{[no]zeroaxis}
  747. \key{sets z-axis label}{zlabel "<label>" <xoff>,<yoff>}
  748. \key{set vertical range}{zrange [<zmin>:<zmax>]}
  749. \key{change vertical tics}{ztics <start>,<incr>,<end>,}
  750. \key{}{"<label>" <pos> }
  751. \key{draw z-axis}{[no]zzeroaxis}
  752. \endindentedkeys
  753.  
  754. \section{Contour Plots}
  755. Enable contour drawing for surfaces. This option is available for {\bf splot}
  756. only.
  757.  
  758. Syntax:
  759.         set contour $\{$ base $|$ surface $|$ both $\}$
  760.         set nocontour
  761.  
  762. If no option is provided to {\bf set contour}, the default is {\bf base}.
  763. The three options specify where to draw the contours: {\bf base} draws
  764. the contours on the grid base where the x/ytics are placed, {\bf surface}
  765. draws the contours on the surfaces themselves, and {\bf both} draws the
  766. contours on both the base and the surface.
  767.  
  768. See also {\bf set cntrparam} for the parameters that affect the drawing of
  769. contours.
  770.  
  771. \section{Contour Parameters}
  772. Sets the different parameters for the contouring plot (see also {\bf contour}).
  773.  
  774.  \key{set cntrparam}{ $\{ \{$ linear $|$ cubicspline $|$ bspline $\} |$}
  775. \key{}{points $<$n$>$ $|$ }
  776. \key{}{order $<$n$>$  $|$ }
  777. \key{}{levels \{ [ auto ] $<$n$>$ $|$ }
  778. \key{}{discrete $<$z1$>$ $<$z2$>$ ... $|$ }
  779. \key{}{incr $<$start$>$ $<$increment$>$ [ $<$n$>$ ] $\} \}$ }
  780.  
  781. \key{5 automatic levels}{set cntrparam levels auto 5}
  782. \key{3 discrete levels at 10\%, 37\% and 90\%}
  783.         {set cntrp levels discrete .1 1/exp(1) .9}
  784. \key{5 incremental levels at 0, .1, .2, .3 and .4}
  785.         {set cntrparam levels incremental  0 .1 5 }
  786. \key{sets n = 10 retaining current setting of auto, incr., or discr.}
  787.         {set cntrparam levels 10 }
  788. \key{set start = 100 and increment = 50, retaining old n}
  789.         {set cntrparam levels incremental 100 50}
  790.  
  791. This command controls the way contours are plotted. $<$n$>$ should be an
  792. integral constant expression and $<$z1$>$, $<$z2$>$ any constant expressions.
  793. The parameters are:
  794.  
  795. {\bf linear}, {\bf cubicspline}, {\bf bspline} - Controls type of approximation or
  796. interpolation. If {\bf linear}, then the contours are drawn piecewise
  797. linear, as extracted from the surface directly. If {\bf cubicspline}, then
  798. piecewise linear contours are interpolated to form a somewhat smoother
  799. contours, but which may undulate. The third option is the uniform
  800. {\bf bspline}, which only approximates the piecewise linear data but is
  801. guaranteed to be smoother.
  802.  
  803. {\bf points} - Eventually all drawings are done with piecewise linear
  804. strokes.  This number controls the number of points used to
  805. approximate a curve.  Relevant for {\bf cubicspline} and {\bf bspline} modes
  806. only.
  807.  
  808. {\bf order}  - Order of the bspline approximation to be used. The bigger this
  809. order is, the smoother the resulting contour.  (Of course, higher order
  810. bspline curves will move further away from the original piecewise linear
  811. data.)  This option is relevant for {\bf bspline} mode only. Allowed values are
  812. integers in the range from 2 (linear) to 10.
  813.  
  814. {\bf levels} - Number of contour levels, 'n'.  Selection of the levels is
  815. controlled by 'auto' (default), 'discrete', and 'incremental'. For 'auto',
  816. if the surface is bounded by zmin and zmax then contours will be
  817. generated from zmin+dz to zmax-dz in steps of size dz, where
  818. dz = (zmax - zmin) / (levels + 1).  For 'discrete', contours will be
  819. generated at z = z1, z2 ... as specified.  The number of discrete levels
  820. is limited to MAX\_DISCRETE\_LEVELS, defined in plot.h to be 30.  If
  821. 'incremental', contours are generated at $<$n$>$ values of z beginning at
  822. $<$start$>$ and increasing by $<$increment$>$.
  823.  
  824. \section{Specifying Labels}
  825. Arbitrary labels can be placed on the plot using the {\bf set label}
  826. command.  If the z coordinate is given on a {\bf plot} it is ignored; if
  827. it is missing on a {\bf splot} it is assumed to be 0.
  828.  
  829. \key{set label $\{<$tag$>\} \{"<$label_text$>"\}$}
  830. {$\{$at $<$x$>,<$y$>\{,<$z$>\}\}$}
  831. \key{}{$\{<$justification$>\}$}
  832. \key{set nolabel $\{<$tag$>\}$}{}
  833. \key{show label}{}
  834.  
  835. The text defaults to '''', and the position to 0,0,0.  The $<$x$>$, $<$y$>$, and
  836. $<$z$>$ values are in the graph's coordinate system.  The tag is an
  837. integer that is used to identify the label. If no $<$tag$>$ is given, the
  838. lowest unused tag value is assigned automatically. The tag can be used
  839. to delete or change a specific label. To change any attribute of an
  840. existing label, use the {\bf set label} command with the appropriate tag,
  841. and specify the parts of the label to be changed.
  842.  
  843. By default, the text is placed flush left against the point x,y,z.
  844. To adjust the way the label is positioned with respect to the point
  845. x,y,z, add the parameter $<$justification$>$, which may be {\bf left}, {\bf right}
  846. or {\bf center}, indicating that the point is to be at the left, right or
  847. center of the text. Labels outside the plotted boundaries are
  848. permitted but may interfere with axes labels or other text.
  849.  
  850. \key{label at (1,2) to ``y=x'' }{set label "y=x" at 1,2}
  851. \key{label ``y=x^2'' w right of the text at (2,3,4), }
  852. {set label 3 "y=x^2" at 2,3,4 right}
  853. \key{\& tag the label number 3 }{}
  854. \key{change preceding label to center justification}{set label 3 center}
  855. \key{delete label number 2 }{set nolabel 2}
  856. \key{delete all labels}{set nolabel}
  857. \key{show all labels (in tag order)}{show label}
  858.  
  859. (The EEPIC, Imagen, LaTeX, and TPIC drivers allow $\backslash$$\backslash$
  860. in a string to specify a newline.)
  861.  
  862. \section{Miscellaneous Commands}
  863.  
  864. For further information on these commands, print out a copy
  865. of the GNUPLOT manual.
  866.  
  867. \key{change working directory}{cd}
  868. \key{erase current screen or device}{clear}
  869. \key{exit GNUPLOT}{exit or quit or EOF}
  870. \key{display text and wait}{pause <time> ["<string>"]}
  871. \key{print the value of $<$expression$>$}{print <expression>}
  872. \key{print working directory}{pwd}
  873. \key{repeat last {\bf plot} or {\bf splot}}{replot}
  874. \key{spawn an interactive shell}{! (UNIX) or \$ (VMS)}
  875.  
  876. \section{Environment Variables}
  877.  
  878. A number of shell environment variables are understood by GNUPLOT.
  879. None of these are required, but may be useful.
  880.  
  881. If GNUTERM is defined, it is used as the name of the terminal type to
  882. be used. This overrides any terminal type sensed by GNUPLOT on start
  883. up, but is itself overridden by the .gnuplot (or equivalent) start-up
  884. file (see {\bf start-up}), and of course by later explicit changes.
  885.  
  886. On Unix, AmigaDOS, and MS-DOS, GNUHELP may be defined to be the pathname
  887. of the HELP file (gnuplot.gih).
  888.  
  889. On VMS, the symbol GNUPLOT\$HELP should be defined as the name of
  890. the help library for GNUPLOT.
  891.  
  892. On Unix, HOME is used as the name of a directory to search for
  893. a .gnuplot file if none is found in the current directory.
  894. On AmigaDOS and MS-DOS, GNUPLOT is used. On VMS, SYS\$LOGIN: is used.
  895. See help start-up.
  896.  
  897. On Unix, PAGER is used as an output filter for help messages.
  898.  
  899. On Unix and AmigaDOS, SHELL is used for the {\bf shell} command. On MS-DOS,
  900. COMSPEC is used for the {\bf shell} command.
  901.  
  902. On AmigaDOS, GNUFONT is used for the screen font.  For example:
  903. ``setenv GNUFONT sapphire/14''.
  904.  
  905. On MS-DOS, if the BGI interface is used, the variable {\bf BGI} is used to point
  906. to the full path to the BGI drivers directory. Furthermore SVGA is used to
  907. name the Super VGA BGI driver in 800x600 res., and its mode of operation
  908. as 'Name.Mode'.
  909. For example, if the Super VGA driver is C:$\backslash$TC$\backslash$BGI$\backslash$SVGADRV.BGI and mode 3 is
  910. used for 800x600 res., then: 'set BGI=C:$\backslash$TC$\backslash$BGI' and 'set SVGA=SVGADRV.3'.
  911.  
  912.  
  913. \section{Expressions}
  914. In general, any mathematical expression accepted by C, FORTRAN,
  915. Pascal, or BASIC is valid. The precedence of these operators is
  916. determined by the specifications of the C programming language.
  917. White space (spaces and tabs) is ignored inside expressions.
  918.  
  919. Complex constants may be expressed as $\{<$real$>,<$imag$>\}$, where
  920. $<$real$>$ and $<$imag$>$ must be numerical constants.  For example,
  921. $\{3,2\}$ represents 3 + 2{\bf i} and $\{0,1\}$ represents {\bf i}
  922. itself.  The curly braces are explicitly required here.
  923. \section{Functions}
  924. The functions in GNUPLOT are the same as the corresponding functions
  925. in the Unix math library, except that all functions accept integer,
  926. real, and complex arguments, unless otherwise noted. The {\bf sgn}
  927. function is also supported, as in BASIC.
  928.  
  929. %\begin{center}
  930. %\begin{tabular}{|ccl|} \hline
  931. \settabs 5\columns
  932. \+Function & Arguments & Returns \cr
  933. \hrule%\hline
  934. \+ abs(x) & any  &  absolute value of {\tt x}, $|x|$; same type \cr
  935. \+ abs(x) & complex &  length of {\tt x}, $\sqrt{{\hbox{real}(x)^{2} +
  936. \hbox{imag}(x)^{2}}}$ \cr
  937. \+ acos(x) & any  & $\cos^{-1} x$ (inverse cosine) in radians \cr
  938. \+ arg(x) & complex & the phase of $x$ in radians\cr
  939. \+ asin(x) & any  & $\sin^{-1} x$ (inverse sin) in radians \cr
  940. \+ atan(x) & any  & $\tan^{-1} x$ (inverse tangent) in radians \cr
  941. \+ besj0(x) & radians &  $j_{0}$ Bessel function of $x$ \cr
  942. \+ besj1(x) & radians & $j_{1}$ Bessel function of $x$ \cr
  943. \+ besy0(x) & radians & $y_{0}$ Bessel function of $x$ \cr
  944. \+ besy1(x) & radians & $y_{1}$ Bessel function of $x$ \cr
  945. \+ ceil(x) & any & $\lceil x \rceil$, smallest integer not less than $x$
  946. (real part) \cr
  947. \+ cos(x) & radians & $\cos x$, cosine of $x$ \cr
  948. \+ cosh(x) & radians & $\cosh x$, hyperbolic cosine of $x$ \cr
  949. \+ erf(x) & any & $\hbox{Erf}(\hbox{real}(x))$,  error function of real($x$) \cr
  950. \+ erfc(x) & any & $\hbox{Erfc}(\hbox{real}(x))$,  1.0 - error function of real($x$) \cr
  951. \+ exp(x) & any & $e^{x}$,  exponential function of $x$ \cr
  952. \+ floor(x) & any & $\lfloor x \rfloor$,  largest integer not greater
  953. than $x$ (real part) \cr
  954. \+ gamma(x) & any & $\hbox{Gamma}(\hbox{real}(x))$,  gamma function of real($x$) \cr
  955. \+ ibeta(p,q,x) & any & $\hbox{Ibeta}(\hbox{real}(p,q,x))$,  ibeta function of real($p$,$q$,$x$) \cr
  956. \+ igamma(a,x) & any & $\hbox{Igamma}(\hbox{real}(a,x))$,  igamma function of real($a$,$x$) \cr
  957. \+ imag(x) & complex &  imaginary part of $x$ as a real number \cr
  958. \+ int(x) & real &  integer part of $x$, truncated toward zero \cr
  959. \+ lgamma(x) & any & $\hbox{Lgamma}(\hbox{real}(x))$,  lgamma function of real($x$) \cr
  960. \+ log(x) & any & $\log_{e} x$,  natural logarithm (base $e$) of $x$ \cr
  961. \+ log10(x) & any & $\log_{10} x$,  logarithm (base $10$) of $x$ \cr
  962. \+ rand(x) & any & $\hbox{Rand}(\hbox{real}(x))$,  pseudo random number generator \cr
  963. \+ real(x) & any &  real part of $x$ \cr
  964. \+ sgn(x) & any & 1 if $x>0$, -1 if $x<0$, 0 if $x=0$. imag($x$) ignored \cr
  965. \+ sin(x) & radians & $\sin x$, sine of $x$ \cr
  966. \+ sinh(x) & radians & $\sinh x$, hyperbolic sine $x$ \cr
  967. \+ sqrt(x) & any & $\sqrt{x}$,  square root of $x$ \cr
  968. \+ tan(x) & radians & $\tan x$,  tangent of $x$ \cr
  969. \+ tanh(x) & radians & $\tanh x$, hyperbolic tangent of $x$\cr
  970. \hrule % \hline
  971. %\end{tabular}
  972. %\end{center}
  973. \section{Operators}
  974. The operators in GNUPLOT are the same as the corresponding operators
  975. in the C programming language, except that all operators accept
  976. integer, real, and complex arguments, unless otherwise noted.
  977. The ** operator (exponentiation) is supported, as in FORTRAN.
  978.  
  979. Parentheses may be used to change order of evaluation.
  980.  
  981.  
  982.  
  983. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  984. \bye
  985. \subsubsection{Binary}
  986. The following is a list of all the binary operators and their
  987. usages:
  988.  
  989.  
  990. \begin{center}
  991. \begin{tabular}{|ccl|} \hline
  992. \multicolumn{3}{|c|}{Binary Operators} \\
  993. Symbol & Example & Explanation \\ \hline
  994. \verb~**~ & \verb~a**b~ & exponentiation\\
  995. \verb~*~ & \verb~a*b~ & multiplication\\
  996. \verb~/~ & \verb~a/b~ & division\\
  997. \verb~%~ & \verb~a%b~ & * modulo\\
  998. \verb~+~ & \verb~a+b~ & addition\\
  999. \verb~-~ & \verb~a-b~ & subtraction\\
  1000. \verb~==~ & \verb~a==b~ & equality\\
  1001. \verb~!=~ & \verb~a!=b~ & inequality\\
  1002. \verb~&~ & \verb~a&b~ & * bitwise AND\\
  1003. \verb~^~ & \verb~a^b~ & * bitwise exclusive OR\\
  1004. \verb~|~ & \verb~a|b~ & * bitwise inclusive OR\\
  1005. \verb~&&~ & \verb~a&&b~ & * logical AND\\
  1006. \verb~||~ & \verb~a||b~ & * logical OR\\
  1007. \verb~?:~ & \verb~a?b:c~ & * ternary operation\\
  1008. \hline
  1009. \end{tabular}
  1010. \end{center}
  1011. (*) Starred explanations indicate that the operator requires
  1012. integer arguments.
  1013.  
  1014. Logical AND (\&\&) and OR ($|$$|$) short-circuit the way they do in C.
  1015. That is, the second \&\& operand is not evaluated if the first is
  1016. false; the second $|$$|$ operand is not evaluated if the first is true.
  1017.  
  1018. The ternary operator evaluates its first argument (a). If it is
  1019. true (non-zero) the second argument (b) is evaluated and returned,
  1020. otherwise the third argument (c) is evaluated and returned.
  1021. \subsubsection{Unary}
  1022. The following is a list of all the unary operators and their
  1023. usages:
  1024.  
  1025.  
  1026. \begin{center}
  1027. \begin{tabular}{|ccl|} \hline
  1028. \multicolumn{3}{|c|}{Unary Operators}\\
  1029. Symbol & Example & Explanation \\ \hline
  1030. \verb@-@ & \verb@-a@ & unary minus \\
  1031. \verb@~@ & \verb@~a@ & * one's complement \\
  1032. \verb@!@ & \verb@!a@ & * logical negation \\
  1033. \verb@!@ & \verb@a!@ & * factorial \\
  1034. \hline
  1035. \end{tabular}
  1036. \end{center}
  1037. (*) Starred explanations indicate that the operator requires an
  1038. integer argument.
  1039.  
  1040. The factorial operator returns a real number to allow a greater range.
  1041. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
  1042.